package com.asset.dispoal.agent;

import com.asset.dispoal.agent.api.SysAgentService;
import com.asset.dispoal.agent.dto.SysAgentRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @author qr
 * @date 2022/3/25$
 */
@RestController
@Api(value = "原告代理人配置管理", tags = "原告代理人配置管理")
@RequestMapping("sys/sysAgent")
public class SysAgentController {

    @Autowired
    SysAgentService sysAgentService;

    @PostMapping("insert")
    @ApiOperation(value = "新增", notes = "新增")
    public Result insert(@RequestBody SysAgentRequest request) {
        return sysAgentService.insert(request);
    }

    @PostMapping("update")
    @ApiOperation(value = "修改", notes = "修改")
    public Result update(@RequestBody SysAgentRequest request) {
        return sysAgentService.update(request);
    }

    @PostMapping("delete")
    @ApiOperation(value = "删除", notes = "删除")
    public Result delete(@RequestBody String id) {
        return sysAgentService.delete(id);
    }

    @GetMapping("queryPage")
    @ApiOperation(value = "分页查询", notes = "分页查询")
    public Result queryPage(SysAgentRequest request) {
        return sysAgentService.queryPage(request);
    }
}